package com.qf.qfdrivermqtt.gateways;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;

@MessagingGateway(defaultRequestChannel = "outChannel")
public interface CmdSender {

    /**
     * 发送指令到默认主题，服务质量等级为默认等级
     * @param msg
     */
    void send(String msg);

    /**
     * 发送指令到指定主题，服务质量等级为默认等级
     * @param topic
     * @param msg
     */
    void send(@Header(MqttHeaders.TOPIC) String topic, String msg);

    /**
     * 发送指令到指定主题，服务质量等级为指定等级
     * @param topic
     * @param msg
     */
    void send(@Header(MqttHeaders.TOPIC)String topic,@Header(MqttHeaders.QOS)Integer qos,String msg);
}
